﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace EMeeting
{
    class ClientClass
    {
        public static string clientMethodsLogin(string userName,string password)
        {
            RestClient clientPost = new RestClient("http://60.30.25.155:8041/", EnumHttpVerb.POST);
            string postback = clientPost.HttpRequest("api/v1/user/login_for_others/?account=" + userName.Replace(" ","")+"&password="+password);
            

            return Unicode2String(postback);
        }
        public static string Unicode2String(string source)
        {
            return new Regex(@"\\u([0-9A-F]{4})", RegexOptions.IgnoreCase | RegexOptions.Compiled).Replace(
                         source, x => string.Empty + Convert.ToChar(Convert.ToUInt16(x.Result("$1"), 16)));
        }
    }
}
